package com.woniu108.evaluate.client;

import com.woniu108.carService.commos.dto.ProductInfoDto;
import com.woniu108.carService.commos.dto.ProductItemDto;
import com.woniu108.carService.commos.model.Result;
import com.woniu108.order.model.form.OrderProductUpdateReviewStateForm;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author LY
 */
@FeignClient(name = "product-server",path = "/product")
public interface ProductClient {

    /**
     * 查询所有正常商品详情
     * @param pItemId  商品总览id
     * @return 商品详情dto
     */
    @GetMapping("/productInfo/findAllNormalProductInfo.c")
    @ApiOperation("查询所有正常商品详情")
    @ApiImplicitParam(name = "pItemId", value = "商品总览id")
    public Result<List<ProductInfoDto>> findAllProductInfo(@RequestParam("pItemId") Integer pItemId);

    /**
     * 通过商品详情ID查商品信息
     * @param pInfoId 商品详情id
     * @return
     */
    @GetMapping("/productInfo/findProductInfoById")
    @ApiOperation("通过商品详情ID查商品信息")
    public Result<ProductInfoDto> findProductInfoById(@RequestParam("pInfoId")Integer pInfoId);

    /**
     * 通过id查商品总览
     * @param pItemId 总览id
     * @return 商品总览详情
     */
    @GetMapping("/productItem/findProductItemByItemId")
    @ApiOperation("通过id查商品总览")
    @ApiImplicitParam(name = "pItemId", value = "总览id")
    public Result<ProductItemDto> findProductItemByItemId(@RequestParam("pItemId") Integer pItemId);
}
